<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<%@ page import="guestbook.Greeting" %>
<%@ page import="guestbook.Box" %>
<%@ page import="guestbook.PMF" %>
<%@ page import="guestbook.FDT_data" %>
<%@ page import="guestbook.RSS_data" %>
<%@ page import="guestbook.PK_data" %>


							<%
									PersistenceManager pm = PMF.get().getPersistenceManager();
									String query = "select from " + RSS_data.class.getName();// + " order by lcd1 desc range 0,5";
									List<RSS_data> rss_datas = (List<RSS_data>) pm.newQuery(query).execute();
									if (rss_datas.isEmpty()) {
							%>

							<p>The RSS_data is empty.</p>

							<%
									} else {
									
							%>
							
							{ "rss": [
							
							<%
											for (RSS_data r : rss_datas) {
							%>
							
							{
							"titolo" 			: "<%= r.get_title().replace("\"","") %>",
							"desc" 				: "<%= r.get_description().replace("&quot","")%>",
							"lat" 				: "<%= r.get_lat() %>",
							"lng" 				: "<%= r.get_lng() %>",
							"date" 				: "<%= r.get_pubDate() %>",
							"link" 				: "<%= r.get_link() %>"
							} ,
							
							<%
											}
									}
									pm.close();
							%>
							{
							"titolo" 			: "",
							"desc" 				: "",
							"lat" 				: "",
							"lng" 				: "",
							"date" 				: "",
							"link" 				: ""
							} 
							]}
